//
//  SEDoctorParticularsVC.m
//  kuaiyi
//
//  Created by vn on 16/7/6.
//  Copyright © 2016年 Alphts. All rights reserved.
//

#import "SEDoctorParticularsVC.h"

@interface SEDoctorParticularsVC ()
//患者头像
@property(nonatomic,strong)UIImageView *user_img;
//患者名字
@property(nonatomic,strong)UILabel * name_lb;
//患者病例
@property(nonatomic,strong)UILabel * disease_lb;
//就诊时间
@property(nonatomic,strong)UILabel * time_lb;
//审核状态
@property(nonatomic,strong)UIButton * state_btn;
//医生lable
@property(nonatomic,strong)UILabel * doctorLable;
//医生lable
@property(nonatomic,strong)UILabel * doctorLable2;
//医生lable
@property(nonatomic,strong)UILabel * doctorLable3;
//医院
@property(nonatomic,strong)UILabel * hospital_lb;
//反馈
@property(nonatomic,strong)UIButton * feedback_btn;
//预约须知
@property(nonatomic,strong)UILabel * inform_lb;

//地址lable
@property(nonatomic,strong)UILabel * address_lb;
//取号时间
@property(nonatomic,strong)UILabel * numTime_lb;
//取号地点
@property(nonatomic,strong)UILabel * numAddress_lb;

//3详细lable
@property(nonatomic,strong)UILabel * AddLable;

@property(nonatomic,strong)UILabel * timeLable;

@property(nonatomic,strong)UILabel * AddLabel2;


@property(nonatomic,strong)UIButton * sms_btn;

@property(nonatomic,strong)UIButton * cancel_btn;


@end

@implementation SEDoctorParticularsVC

- (void)viewDidLoad {
    [super viewDidLoad];
   
    
    [self setUpUI];
}

#pragma mark -- 布局子控件
- (void)viewDidLayoutSubviews{
    
    [super viewDidLayoutSubviews];
    
        [self.user_img mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.top.offset(80);
            make.left.offset(20);
            
        }];
       
        [self.name_lb mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.top.equalTo(self.user_img.top);
            make.left.equalTo(self.user_img.right).offset(15);
            
            
        }];
        
        
        [self.disease_lb mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.top.equalTo(self.name_lb.top);
            make.left.equalTo(self.name_lb.right).offset(15);
            
            
        }];
        
        
        [self.time_lb mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.top.equalTo(self.name_lb.bottom);
            make.left.equalTo(self.name_lb.left);
            
            
        }];
        
        
        [self.state_btn mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.width.offset(50);
            make.height.offset(50);
            make.top.offset(75);
            make.right.offset(-25);
            
            
        }];
        
        
        [[self setUpView] mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.width.offset(self.view.frame.size.width);
            make.height.offset(2);
            make.top.equalTo(self.time_lb.bottom).offset(15);

            
        }];
        
        
        [self.doctorLable mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.top.equalTo(self.time_lb.bottom).offset(25);
            make.left.equalTo(self.user_img.left);
            
        }];
        
        
           [[self setUpView]mas_makeConstraints:^(MASConstraintMaker *make) {
              
               make.top.equalTo(self.doctorLable.bottom).offset(10);
               make.width.offset(self.view.frame.size.width);
               make.height.offset(2);

               
           }];
        
        
        
            [self.doctorLable2 mas_makeConstraints:^(MASConstraintMaker *make) {
               
                make.top.equalTo(self.doctorLable.bottom).offset(25);
                make.left.equalTo(self.doctorLable.left);
                
                
            }];
        
        
        
        
            [self.doctorLable3 mas_makeConstraints:^(MASConstraintMaker *make) {
               
               
                make.top.equalTo(self.doctorLable2.top);
                make.left.equalTo(self.doctorLable2.right).offset(15);
                
            }];
        
    
        [self.hospital_lb mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.top.equalTo(self.doctorLable2.bottom).offset(10);
            make.left.equalTo(self.doctorLable2.left);
            
        }];
    
    
        [self.feedback_btn mas_makeConstraints:^(MASConstraintMaker *make) {
           
            
            make.width.offset(70);
            make.height.offset(35);
            make.top.equalTo(self.doctorLable3.bottom).offset(-10);
            make.right.offset(-20);
            
            
            
        }];


        [[self setUpView]mas_makeConstraints:^(MASConstraintMaker *make) {
           
            
            make.top.equalTo(self.hospital_lb.bottom).offset(10);
            make.width.offset(self.view.frame.size.width);
            make.height.offset(2);

            
            
        }];


    
        [self.inform_lb mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.top.equalTo(self.hospital_lb.bottom).offset(25);
            make.left.equalTo(self.hospital_lb.left);
            
            
        }];


    [[self setUpView]mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.inform_lb.bottom).offset(10);
        make.width.offset(self.view.frame.size.width);
        make.height.offset(2);

        
        
    }];

    
    [self.address_lb mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.inform_lb.bottom).offset(25);
        make.left.equalTo(self.inform_lb.left);
        
        
        
    }];
    
    [self.numTime_lb mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.address_lb.bottom).offset(10);
        make.left.equalTo(self.address_lb.left);
        
    }];
    
    [self.numAddress_lb mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.numTime_lb.bottom).offset(10);
        make.left.equalTo(self.numTime_lb.left);
        
    }];
    
    
    [self.AddLable mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.address_lb.top);
        make.left.equalTo(self.address_lb.right).offset(15);
        
    }];
    
    
    
    [self.timeLable mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.numTime_lb.top);
        make.left.equalTo(self.numTime_lb.right).offset(15);

        
    }];
    
    
    [self.AddLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.numAddress_lb.top);
        make.left.equalTo(self.numAddress_lb.right).offset(15);
        
        
    }];

    [[self setUpView]mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.numAddress_lb.bottom).offset(10);
        make.width.offset(self.view.frame.size.width);
        make.height.offset(2);

        
        
    }];
    
    
    [self.sms_btn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.offset(15);
        make.bottom.offset(-20);
        make.right.equalTo(self.cancel_btn.left).offset(-40);
        make.width.equalTo(self.cancel_btn.mas_width);
        
    } ];
    
    [self.cancel_btn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.offset(-15);
        make.bottom.offset(-20);
        make.left.equalTo(self.sms_btn.mas_right).offset(40);
        make.width.equalTo(self.sms_btn.mas_width);
    } ];

}


#pragma mark -- 初始化子控件
- (void)setUpUI{
    
    self.user_img = [[UIImageView alloc]init];
    
    self.user_img.image = [UIImage imageNamed:@"illness_img_person.png"];
    
    [self.user_img sizeToFit];
    [self.view addSubview:self.user_img];
    
    
    self.name_lb = [[UILabel alloc]init];
    self.name_lb.text =self.model.Pname;
    [self.view addSubview:self.name_lb];
    
    
    self.disease_lb = [[UILabel alloc]init];
    self.disease_lb.text = self.model.bing;
    self.disease_lb.textColor = [UIColor grayColor];
    [self.view addSubview:self.disease_lb];
    
    
    self.time_lb = [[UILabel alloc]init];
    self.time_lb.text = self.model.Time;
    self.time_lb.textColor = [UIColor grayColor];
    [self.view addSubview:self.time_lb];
    
    
    self.state_btn = [[UIButton alloc]init];
    self.state_btn.layer.cornerRadius = 25;
    
    [self.state_btn setTitle:@"审核中" forState:UIControlStateNormal];
    self.state_btn.titleLabel.font = [UIFont systemFontOfSize:14];
    [self.state_btn setBackgroundColor:[UIColor colorWithRed:0.149 green:0.4281 blue:0.73 alpha:1.0]];
    [self.view addSubview:self.state_btn];
    
    
    self.doctorLable = [[UILabel alloc]init];
    self.doctorLable.text = @"预约医生:";
    self.doctorLable.textColor = [UIColor grayColor];
    
    [self.view addSubview:self.doctorLable];
    
    self.doctorLable2 = [[UILabel alloc]init];
    self.doctorLable2.text = @"马医生";
    [self.view addSubview:self.doctorLable2];
    
    
    self.doctorLable3  = [[UILabel alloc]init];
    self.doctorLable3.textColor = [UIColor grayColor];
    self.doctorLable3.text = @"主任医师";
    [self.view addSubview:self.doctorLable3];
    
    
    self.hospital_lb = [[UILabel alloc]init];
    self.hospital_lb.textColor = [UIColor grayColor];
    self.hospital_lb.text = @"上海长征医院";
    [self.view addSubview:self.hospital_lb];
    
     self.feedback_btn = [[UIButton alloc]init];
    self.feedback_btn.adjustsImageWhenHighlighted = NO;
    [self.feedback_btn setBackgroundImage:[UIImage imageNamed:@"dijiaofankui"] forState:UIControlStateNormal];
    [self.view addSubview:self.feedback_btn];
    
    
     self.inform_lb = [[UILabel alloc]init];
    self.inform_lb.textColor = [UIColor grayColor];
    self.inform_lb.text = @"预约须知:";
    [self.view addSubview:self.inform_lb];
    
    self.address_lb = [[UILabel alloc]init];
    self.address_lb.text = @"就诊地点:";
    [self.view addSubview:self.address_lb];
    
    self.numTime_lb = [[UILabel alloc]init];
    self.numTime_lb.text = @"取号时间:";
    [self.view addSubview:self.numTime_lb];

    self.numAddress_lb = [[UILabel alloc]init];
    self.numAddress_lb.text = @"取号地点:";
    [self.view addSubview:self.numAddress_lb];

    
    self.AddLable = [[UILabel alloc]init];
    self.AddLable.textColor = [UIColor grayColor];
    self.AddLable.text =@"上海长征医院2号楼心血管内科";
    [self.view addSubview:self.AddLable];
    
    self.timeLable = [[UILabel alloc]init];
    self.timeLable.text = @"9:00 - 10:00";
    self.timeLable.textColor = [UIColor grayColor];
    [self.view addSubview:self.timeLable];
    
    
    self.AddLabel2 = [[UILabel alloc]init];
    self.AddLabel2.textColor = [UIColor grayColor];
    self.AddLabel2.text = @"上海长征医院住院部";
    [self.view addSubview:self.AddLabel2];
    
    
    self.sms_btn = [[UIButton alloc]init];
    [self.sms_btn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [self.sms_btn setTitle:@"短信重发" forState:UIControlStateNormal];
    self.sms_btn.adjustsImageWhenHighlighted = NO;
    [self.sms_btn setBackgroundImage:[UIImage imageNamed:@"link_button_02"] forState:UIControlStateNormal];
    [self.view addSubview:self.sms_btn];
    
    self.cancel_btn = [[UIButton alloc]init];
    self.cancel_btn.adjustsImageWhenHighlighted = NO;
    [self.cancel_btn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [self.cancel_btn setTitle:@"取消预约" forState:UIControlStateNormal];
    [self.cancel_btn setBackgroundImage:[UIImage imageNamed:@"link_button_02"] forState:UIControlStateNormal];
    [self.view addSubview:self.cancel_btn];

    
}
#pragma mark -- 创建View;
 - (UIView *)setUpView{
    
    UIView * view  = [[UIView alloc]init];
    [self.view addSubview:view];
     
    view.backgroundColor = [UIColor grayColor];

     return view;
    
    
    
}


@end
